﻿using System;
namespace YXYLCommon
{
    [Serializable]
    public class JsonRs//:System.Web.Mvc.JsonResult
    {
        public JsonRs()
        {
            //this.ContentType = "text/html; charset=utf-8";
        }
        public JsonRs(bool state,string msg,object data)
        {
            //this.ContentType = "application/json; charset=utf-8";
            this.State = state;
            this.Msg = msg;
            this.Data1 = data;
        }

        /// <summary>
        /// 增删改返回值(一般用于存储添加修改对象ID)
        /// </summary>
        public int ReturnValue { get; set; }
        /// <summary>
        ///[1 成功] [-1:失败]
        /// </summary>
        public bool State { get; set; }

        /// <summary>
        /// 返回消息
        /// </summary>
        public string Msg { get; set; }

        /// <summary>
        /// 返回的数据Data1
        /// </summary>
        public object Data1 { get; set; }

        /// <summary>
        /// 返回的数据Data2
        /// </summary>
        public string Data2 { get; set; }

        /// <summary>
        /// 返回的数据Data3
        /// </summary>
        public string Data3 { get; set; }
    }


    [Serializable]
    public class LayerJsonRs//:System.Web.Mvc.JsonResult
    {
        public LayerJsonRs()
        {
            //this.ContentType = "text/html; charset=utf-8";
        }
        public LayerJsonRs(int code, string msg, int count,object data)
        {
            //this.ContentType = "application/json; charset=utf-8";
            this.code = code;
            this.msg = msg;
            this.count = count;
            this.data = data;
        }
        public LayerJsonRs(int count, object data)
        {
            //this.ContentType = "application/json; charset=utf-8";
            this.code = 0;
            this.msg = "";
            this.count = count;
            this.data = data;
        }

        /// <summary>
        ///[1 成功] [-1:失败]
        /// </summary>
        public int code { get; set; }

        /// <summary>
        /// 返回消息
        /// </summary>
        public string msg { get; set; }

        public int count { get; set; }


        /// <summary>
        /// 返回的数据Data1
        /// </summary>
        public object data { get; set; }
    }
}